home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / nask16.zip / NASK.DOC < prev    next >
Text File  |  1991-10-30  |  4KB  |  104 lines

  1. N-ASK Batch Util   (c) 1990 Sean Wachob                                     -1-
  2.  
  3.             ___      __           ___       ________   __    ___
  4.            |   \    |  |         / _ \     /  ______| |  |  /  /
  5.            |     \  |  |  __   /  / \  \  (  (_____   |  |/  /
  6.            |  |\   \|  | |__| |  |___|  |  \_____  \  |     <
  7.            |  |  \     |      |   ___   |  ______)  ) |  |\  \
  8.            |__|    \___|      |__|   |__| |________/  |__|  \__\
  9.  
  10.                                  Ver 1.6
  11.  
  12.    This is an interactive question asking program used in BATCH files.  It
  13. is used in the form of:
  14.  
  15.  NASK "<question>",<possible responses> [-B] [-S]
  16.                             [-D=<default answer>] [-?] [-A]
  17.  
  18.    The question is any string of characters (including quotes inside the
  19. delimeters).  The possible responses are all the letters/numbers that may be
  20. used to respond to the question.  These are non-case senstive so you may put
  21. them either in upper or lower case.  The -B option makes the program beep when
  22. a response is entered that is not in the possible answers.  The -S option will
  23. keep the cursor on the same line as the prompted question.  The -D, for default
  24. answer, will return the letter put after the equal sign when you hit enter at
  25. the prompted question.  The short help is availiable with the -? or when N-ASK
  26. is run without any parameters.  The -A function will return the ascii value of
  27. the key pressed for the errorlevel.  This will be demonstrated later.
  28.  
  29.    You can use NASK to write batch menus such as:
  30.  
  31.   ECHO OFF
  32.   ECHO   [A] MYPROG.EXE
  33.   ECHO   [B] BLAH.BAT
  34.   ECHO   [C] WHATEVER.COM
  35.   ECHO   [D] QUIT
  36.   ECHO"
  37.   NASK "Which one do you want? ",ABCD -s -b -d=A
  38.   if errorlevel 4 goto DONE
  39.   if errorlevel 3 goto THIRD
  40.   if errorlevel 2 goto SECOND
  41.   if errorlevel 1 goto FIRST
  42.  
  43.   :FIRST
  44.      MYPROG.EXE
  45.      GOTO DONE
  46.   :SECOND
  47.      CALL BLAH.BAT
  48.      GOTO DONE
  49.   :THIRD
  50.      WHATEVER.COM
  51.      GOTO DONE
  52.  
  53.   :DONE
  54.  
  55.  
  56.    This batch file will ECHO the availiable options and wait for the user
  57. press one of the keys (A,B,C or D), will stay on the same line as the question,
  58. and then will beep if they hit any other's besides those three keys.  If they
  59. hit return, it will use "A" as the answer because it was set to the default.
  60. Then NASK will exit with an exit code relative to the position of the letter
  61. in the choices string.  Remember, in a batch process, errorlevel x means an
  62. exit code of x or HIGHER!  You must do the IF ERRORLEVEL in decending order
  63. to sort out the errorlevels.
  64.  
  65. N-ASK Batch Util   (c) 1990 Sean Wachob                                     -2-
  66.  
  67.    Another way to use this program is like this:
  68.  
  69.          NASK "Press a Key:" -AS
  70.  
  71.     This will print the "Press a Key" message and wait for any key to be
  72. pressed.  Then instead of the errorlevel returned being the position of the
  73. answer in the list you gave before, the errorlevel value is now set to the
  74. ascii value of the key pressed.  In the case of a Function key, things are a
  75. little different.  Lets say for instance that you pressed the F7 key.  The
  76. computer returns a character 0 then a 65.  BUT, 65 is the same as a capital
  77. letter "A" so you have to watch out for these things.
  78.  
  79.  
  80.  
  81. Notes:
  82.  
  83.       o  You may put multiple commands after a single dash like this:
  84.          NASK "What is your answer: ",123 -bsd=1
  85.  
  86.       o  You do not really need quotes around the question unless you are
  87.          using a comma or you want spaces at the end of the question.
  88.  
  89.       o  If question is used without quotes, quotes may be put inside the
  90.          question as long as they are not the first or last character.
  91.  
  92.  
  93.    This program is ShareWare which means you may freely copy and distribute
  94. this program.  If you like this program and use it often, you should support
  95. the ShareWare concept by sending $10 (make checks and money orders payable
  96. to "Sean Wachob") to:
  97.  
  98.              Sean Wachob
  99.              PO Box 10372
  100.              San Jose, CA   95157-1372
  101.  
  102.   Comments or suggestions may be sent to this same address.  Thank you for
  103. using NASK and pleaselook for future releases.....
  104.